var customer = {
  add : function() {
    new WindowPanel({
      id: 'saveCustomer',
      title: '新增客户信息',
      width: 620,
      height: 420,
      closeConfirm : true,
      maximizable: false,
      html : '<iframe name="customerSaveFrame" id="customerSaveFrame" src="'+projectName+'/sales/customer/toSave.t4m?'+getFlushParam('saveCustomer')+'" frameborder="0" scrolling="auto"></iframe>',
      tbar: new Toolbar({
        icon: 'image/op.gif',
        items : [{
          type : 'button',
          text : '保存',
          position: {
            a: '-80px 0px',
            b: '-80px -120px'
          },
          handler : function(){
            if(getFrame('customerSaveFrame').validate()) {
              submitFrameForm('customerSaveFrame', 'customerForm');
            }
          }
        }]
      })
    });
  },
  view : function(id) {
	    new WindowPanel({
	      id: 'viewCustomer',
	      title: '客户信息',
	      width: 620,
	      height: 420,
	      closeConfirm : true,
	      maximizable: false,
	      html : '<iframe name="customerViewFrame" id="customerViewFrame" src="'+projectName+'/sales/customer/view.t4m?'+getFlushParam('viewCustomer')+'&customer.id='+id+'" frameborder="0" scrolling="auto"></iframe>',
	    });
	  },
	update : function(id) {
		    new WindowPanel({
		      id: 'updateCustomer',
		      title: '修改客户信息',
		      width: 620,
		      height: 420,
		      closeConfirm : true,
		      maximizable: false,
		      html : '<iframe name="customerUpdateFrame" id="customerUpdateFrame" src="'+projectName+'/sales/customer/toUpdate.t4m?'+getFlushParam('updateCustomer')+'&customer.id='+id+'" frameborder="0" scrolling="auto"></iframe>',
		      tbar: new Toolbar({
		          icon: 'image/op.gif',
		          items : [{
		            type : 'button',
		            text : '保存',
		            position: {
		              a: '-80px 0px',
		              b: '-80px -120px'
		            },
		            handler : function(){
		               submitFrameForm('customerUpdateFrame', 'customerForm');
		            }
		          }]
		        })
		    });
	},
		  
  choose : function() {
    openCenterWindow({
      url:projectName+'/sales/customer/choose.t4m',
      width:500,
      height:300
    });
  }
};